﻿using System;
using System.Collections.Generic;

namespace PTop.Domain.Entity.Questionnaire
{
    /// <summary>
    /// 调查问卷试题Entity
    /// </summary>	
    public class QnQuestionEntity : IEntity<QnQuestionEntity>, ICreationAudited, IModificationAudited
    {

        /// <summary>
        /// 
        /// </summary>
        public string F_Id { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string F_PaperId { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string F_PaperTitle { get; set; }
        /// <summary>
        /// 问题题型,1=单选,2=多选,3=评分
        /// </summary>
        public int F_Type { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string F_Question { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        public int F_OrderId { get; set; }
        /// <summary>
        /// 选项数
        /// </summary>
        public int F_OptionCont { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string F_Option1 { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string F_Option2 { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string F_Option3 { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string F_Option4 { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string F_Option5 { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string F_Option6 { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string F_Option7 { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string F_Option8 { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string F_Option9 { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string F_Option10 { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string F_CreatorUserId { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public DateTime? F_CreatorTime { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string F_LastModifyUserId { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public DateTime? F_LastModifyTime { get; set; }

        public string GetOption(int i)
        {
            switch (i)
            {
                case 1: return F_Option1;
                case 2: return F_Option2;
                case 3: return F_Option3;
                case 4: return F_Option4;
                case 5: return F_Option5;
                case 6: return F_Option6;
                case 7: return F_Option7;
                case 8: return F_Option8;
                case 9: return F_Option9;
                case 10: return F_Option10;
                default: return null;
            }
        }

        public string[] GetOptions()
        {
            var list = new List<string>();
            for (var i = 0; i < F_OptionCont; i++)
            {
                if (i == 0) list.Add(F_Option1);
                if (i == 1) list.Add(F_Option2);
                if (i == 2) list.Add(F_Option3);
                if (i == 3) list.Add(F_Option4);
                if (i == 4) list.Add(F_Option5);
                if (i == 5) list.Add(F_Option6);
                if (i == 6) list.Add(F_Option7);
                if (i == 7) list.Add(F_Option8);
                if (i == 8) list.Add(F_Option9);
                if (i == 9) list.Add(F_Option10);
            }
            return list.ToArray();
        }
    }
}